//
//  NewsOrdinaryTableViewCell.m
//  TimeMovie
//
//  Created by zc on 15/12/4.
//  Copyright (c) 2015年 qianfeng. All rights reserved.
//

#import "NewsOrdinaryTableViewCell.h"

@interface NewsOrdinaryTableViewCell ()
@property (weak, nonatomic) IBOutlet UIButton *iconButton;
@property (weak, nonatomic) IBOutlet UILabel *tabLabel;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;

@end

@implementation NewsOrdinaryTableViewCell

- (void)awakeFromNib {
    // Initialization code
    if(_model){
    if(!([_model.tag isEqualToString:@"无"])){
        
        _tabLabel.text = _model.tag;
        _tabLabel.backgroundColor = [UIColor redColor];
    
    }else{
        
        _tabLabel.text = nil;
    }
    
        [_iconButton sd_setBackgroundImageWithURL:[NSURL URLWithString:_model.image] forState:UIControlStateNormal];
        if([_model.type intValue] == 2){
            
            [_iconButton setImage:[UIImage imageNamed:@"v10_collectVideoNews_29"] forState:UIControlStateNormal];
        }
        
    _titleLabel.text = _model.summary;
    _contentLabel.text = _model.summaryInfo;
#warning 还有个时间没有算出来加上去
    
    _timeLabel.text = [NSString stringWithFormat:@"评论 %@",_model.commentCount];
    }
    
    
}
- (void)setModel:(newsTableViewModel *)model{
    _model = model;
    
    [self awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
